package org.poem.common.response;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author poem
 */
@Data
@NoArgsConstructor
public class CommonResult<T> {

    /**
     * 数据
     */
    private T data;

    /**
     * code
     */
    private Integer code;

    /**
     * 消息
     */
    private String message;

    public CommonResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public CommonResult(Integer code, String message, T date) {
        this.code = code;
        this.message = message;
        this.data = date;
    }

    public CommonResult(T data) {
        this.data = data;
        this.code = 200;
    }

    public CommonResult(Integer code, T data) {
        this.data = data;
        this.code = code;
    }

}
